package com.example.carrierapp.ui.main.dispatch.waybilllist;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentTransaction;
import android.view.View;

import com.example.carrierapp.base.BaseActivity;
import com.example.carrierapp.config.ConstValue;
import com.example.carrierapp.ui.main.waybill.arriveyes.WaybillArriveYesFragment;
import com.example.lb.fingerdemo.R;

public class WaybillListActivity extends BaseActivity{

    private WaybillArriveYesFragment fragment;

    @Override
    public int getContentView() {
        return R.layout.activity_waybill_list_new;
    }

    @Override
    public String getTitleString() {
        return "已送达";
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBottomLine.setVisibility(View.GONE);
        int waybillId=getIntent().getIntExtra(ConstValue.ID,-1);
        int transId=getIntent().getIntExtra(ConstValue.TRANS_ID,-1);
        fragment = (WaybillArriveYesFragment) getSupportFragmentManager().findFragmentByTag("WaybillArriveYesFragment");
        if (fragment == null) {
            fragment = WaybillArriveYesFragment.Companion.newInstance(waybillId,transId);
        }
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        //添加Fragment
        if (!fragment.isAdded()) {
            transaction.add(R.id.fragment_content, fragment, "WaybillArriveYesFragment");
        }
        //提交
        transaction.commit();
    }
}
